# -*- conding:UTF-8 -*-

'''
@ Project: P8_lxpro_7.7
@ File: token_authxxx.py
@ Author: 罗婷
@ Date：2022/7/7 17:13

'''
from flask import request, g

from common.utils.jwtToken_gen_che import verify_token

# 钩子函数 获取token 赋值g.uid
def check_auth():
    g.uid = None
    token = request.headers.get('Authorization')
    # print('token~~~~~~~', token)
    if token:
        payload = verify_token(token)
        # payload = check_token(token)
        # print('钩子 payload~~~~~~~', payload)
        if payload:
            g.uid = payload['uid']
            # print('g.uid~~~~~~~', g.uid)








